import request from '../utils/request.js'

export function doLogin(openId,password) {
	// https://2306.tech/CCShop/user/android/login?username=18810642306&password=123456
	// {
	//     "result": "true"
	// }
	return request('user/android/login?username=' + openId + '&password=' + password)
}

export function doRegister(userId,userPwd,userRealName) {
	// if (userMapper.insert(u) > 0)
	// 	rsMap.put("result", "true"); //不存在
	// else
	// 	rsMap.put("result", "false"); //存在
	return request('user/insert',{
		userId:userId,
		userOpenid:userId,
		userPassword:userPwd,
		userRealName:userRealName,
		userNickName:userRealName,
		userPhoneCall:userId,
		userAddress:'北京城市学院'
	})

}

export function checkExist(openId) {
	// out.println(JSONObject.fromObject(u));
	return request('user/select/exist/' + openId)
}

export function getScoreByOpenId(openId) {
	// rsMap.put("result",userMapper.selectUserScoreByUserOpenid(openId));
	return request('user/select/score/' + openId)
}
